<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>管理员:新闻列表页</title>
<link rel="stylesheet" href="https://www.jq22.com/jquery/bootstrap-3.3.4.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/base.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/jquery-kq-nav-left.css">
<style type="text/css">
ul li{
	display:inline-block;/* 将li设置为行内元素 */
	color: black;
	display:absolute;
	margin-left:20px;
}
#li{
	margin-left:450px;
}
</style>
</head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.6.1.js"></script>
<body>
	<div>
		<ul class="breadcrumb">
			<li><a href="#">新闻管理</a></li>
			<li><a href="#">新闻列表</a></li>
		</ul>
		<table class="table table-hover">
				<tr>
					<th>标题</th>
					<th>类型</th>
					<th>发布人</th>
					<th>修改</th>
					<th>删除</th>
				</tr>
				<c:forEach items ="${news }" var="item">
				<tr>
				<td>${item.title }</td>
				<c:if test="${item.news_type==0}">
							<td>社会新闻</td>
						</c:if>
						<c:if test="${item.news_type==1}">
							<td>娱乐新闻</td>
						</c:if>
						<c:if test="${item.news_type==2}">
							<td>财经新闻</td>
						</c:if>
						<c:if test="${item.news_type==3}">
							<td>科技新闻</td>
						</c:if>
						<c:if test="${item.news_type==4}">
							<td>体育新闻</td>
						</c:if>
						<c:if test="${item.news_type==5}">
							<td>其他新闻</td>
						</c:if>
				<td>${item.user_id }</td>
				<td><a href="${pageContext.request.contextPath }/adminnewseditpage?id=${item.id}">修改</a></td>
				<td><a href="${pageContext.request.contextPath }/adminnewsdelete?id=${item.id}">删除</a></td>
			</tr>
			</c:forEach>	
		</table>
		<ul>
			<c:forEach items="${pages }" var="page">
				<li><a href="${pageContext.request.contextPath }/adminnewslist?current=${page.number }">${page.number }</a></li>
			</c:forEach><br>
			<li id="li"><em>第${curPage}页/共${pageCount}页</em></li>
		</ul>
	</div>
</body>
</html>
